body {
  font-family: "RM Neue";
  margin: 0;
  min-width: 1024px;
  padding: 0;
}

header {
  align-items: center;
  display: flex;
  justify-content: space-between;
  margin: 0 auto;
  padding: 20px;
  max-width: 1100px;

  img {
    width: 260px;
    margin: 0 8px;
  }

  ul {
    margin: 0 48px 0 0;

    @media (max-width: 1130px) {
      & {
        display: none;
      }
    }
  }

  li {
    display: inline-block;

    a {
      color: $purple;
      display: block;
      font-weight: bold;
      line-height: 28px;
      padding: 10px;

      &.button {
        border-radius: 2px;
        margin-left: 10px;
        padding: 5px 10px;
      }

      &.button-lime {
        background-color: $lime;
        color: $purple;
      }

      &.button-purple {
        background-color: $purple;
        color: white;
      }
    }
  }
}

.content-wrapper {
  border-top: 1px solid $grey-light;
  display: flex;
  justify-content: center;
}

.content {
  flex: 1000;
  min-height: calc(100vh - 89px);
  // https://weblog.west-wind.com/posts/2016/Feb/15/Flexbox-Containers-PRE-tags-and-managing-Overflow
  min-width: 0;
  max-width: 800px;
  padding: 0 40px;
}

.algolia-autocomplete {
  width: 100%;

  .ds-cursor .algolia-docsearch-suggestion--content {
    background: rgba($purple, 0.03) !important;
  }

  .algolia-docsearch-suggestion--highlight {
    background: rgba($purple, 0.03) !important;
    color: $purple !important;
    box-shadow: inset 0 -2px 0 0 $purple-40 !important;
  }
}

#search-input {
  border-radius: 5px;
  border: 1px solid $grey;
  box-sizing: border-box;
  font-family: "RM Neue";
  font-size: 15px;
  margin-bottom: 12px;
  padding: 3px 5px;
  width: 100%;
}

.sidebar-wrapper {
  background-image: linear-gradient($purple-1, $white);
  border-right: 1px solid $grey-light;
  flex: 1;
}

.sidebar {
  font-size: 15px;
  padding: 20px;
  margin-left: auto;
  max-width: 280px;
  min-width: 200px;

  a {
    display: block;
    color: $purple;
    cursor: pointer;

    &.active {
      font-weight: bold;
    }
  }

  ul {
    list-style-type: none;
    margin-top: 0;
    padding-left: 0;
  }

  li.level-1 {
    border-bottom: 1px solid $grey-extra-light;
    padding: 7px;

    &.has-children {
      ul {
        display: none;
        margin-top: 5px;
      }

      > a::after {
        content: "";
        border-left: 4px solid scale-color($purple, $lightness: 15%);
        border-top: 4px solid transparent;
        border-bottom: 4px solid transparent;
        display: inline-block;
        font-weight: bold;
        margin-left: 2px;
        transition: transform 0.3s;
      }
    }

    &.open {
      ul {
        display: block;
      }

      > a::after {
        transform: rotate(90deg);
      }
    }
  }

  li.level-2 {
    padding-left: 15px;

    a {
      font-size: 14px;
      padding: 3px 0;
    }
  }
}

.toc-wrapper {
  border-left: 1px solid $grey-light;
  flex: 1;
}

.toc-dummy {
  flex: 1;
}

.toc {
  font-size: 14px;
  max-width: 280px;
  min-width: 180px;
  padding: 10px 15px;
  position: sticky;
  top: 0;

  h2 {
    font-size: 16px;
    margin: 0 0 5px;
    padding: 0;
  }

  ul {
    list-style-type: none;
    margin: 0;
    padding: 0;
  }

  ul ul {
    margin-left: 15px;
  }

  li {
    padding: 3px 0;
  }

  a {
    color: scale-color($grey-dark, $lightness: 15%);

    &.active {
      color: $purple;
      font-weight: 500;
    }
  }

  nav > ul > li > a {
    font-weight: 500;
  }
}

.footer {
  color: $grey-dark;
  font-size: 14px;
  margin: 50px 0 10px;
  text-align: center;
}
